{% extends "layout.html" %}

{% block content %}
    <div class="card-header">
        <a class="btn btn-outline-primary btn-sm" href="/user/add/" role="button">新增</a>
        <a class="btn btn-outline-primary btn-sm" href="/user/model/form/add/" role="button">modelform新增</a>
    </div>
    <div class="container">
        <table class="table table-hover container">
            <thead>
            <tr>
                <th scope="col">ID</th>
                <th scope="col">姓名</th>
                <th scope="col">密码</th>
                <th scope="col">年龄</th>
                <th scope="col">入职时间</th>
                <th scope="col">账户余额</th>
                <th scope="col">性别</th>
                <th scope="col">部门</th>
                <th scope="col">操作</th>
            </tr>
            </thead>
            <tbody>
            {% for item in data %}
                <tr>
                    <th>{{ item.id }}</th>
                    <td>{{ item.name }}</td>
                    <td>{{ item.password }}</td>
                    <td>{{ item.age }}</td>
                    <td>{{ item.create_time|date:"Y-m-d" }}</td>
                    <td>{{ item.account }}</td>
                    <td>{{ item.get_gender_display }}</td>
                    <td>{{ item.depart.title }}</td>
                    <td>
                        <a class="btn btn-primary btn-sm" href="/user/{{ item.id }}/update" role="button">修改</a>
                        <a class="btn btn-danger btn-sm" href="/user/{{ item.id }}/delete" role="button">删除</a>
                    </td>
                </tr>

            {% endfor %}
            </tbody>
        </table>
        <div class="container">
            {{ page_list }}
        </div>
    </div>

{% endblock %}